<%@ page language="java" pageEncoding="UTF-8" buffer="16kb"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<%@ include file="/module/js.jsp"%>
<%@ include file="/module/orderField.jsp"%>
<script type="text/javascript" src="${basePath}/js/jquery.Huploadify.js"></script>
<link href="${basePath}/css/Huploadify.css" rel="stylesheet">
	<style>
table label.error {
	margin-left: 5px;
	width: auto;
	display: inline;
	color: red;
}
</style>
<script>
$(document).ready(
					function() {
						$("#div1").dialog({
							width : 'auto',
							height : 'auto',
							bgiframe : true,
							modal : true,
							draggable : true,
							resizable : false,
							title : '选择负责人',
							autoOpen : false,
						    buttons : {
						    '取消' : function() {
						    	$(this).dialog('close');
							},
							'确定' : function() {
							  
							  if($("#fromSelect").val()==null||$("#fromSelect").val()==""){
								 alert("请选择一项");
								 return false;
							  }else{
								    var formSelect = document.getElementById("fromSelect");
								    var str = [];
								    var num=0;
								    for(i=0;i<formSelect.length;i++){
								        if(formSelect.options[i].selected){
								            //str.push(select[i].value);
								            num++;
								        }
								    }
								    if(num>=2){
								      layer.alert("只能选择一项", {icon: 6});
								      return false;
								    }
								  
								  var str=$("#fromSelect").val()+"";
								  var strs = str.split(","); 
								  for(i=0;i<strs.length;i++){
									  if(i==0){
										  $("#dbempid").val(strs[i]);
                                      }
									  if(i==1){
										  $("#dbzgh").val(strs[i]);  
									  }
								  }
								
							     $("#xM").val($("#fromSelect").find("option:selected").text()); 
							     $("#gH").val($("#fromSelect").find("option:selected").val());		
								  $(this).dialog('close');
							  }	  
							  /* var mycars=$("#fromSelect").val();
							  var g= mycars.toString();
							  alert(g);
							  var strArry = mycars.split(',');
							  if(strArry.length>1){
								  alert("负责人只能选择一个");  
								  return false;
							  } */
							}
						  }
						});

					});
	function showdiv() {
		$('#div1').dialog('open');
	}
</script>
</head>
<body>
	<form action="#" name="Form" id="Form" method="post">
		<input type="hidden" name="dYID" id="dYID" value="${PartyMemberEvaluation.dYID}" />
		<input type="hidden" name="zSID" id="zSID" value="${PartyMemberEvaluation.zSID}" />
		<table cellpadding="0" cellspacing="0" border="0" class="table-border"
			width="100%">
			<tr>
				<td class="table-header" colspan="4">党员个人先锋指数</td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width: 15%" >姓名:</td>
				<td class="table-contentTD" style="width: 20%" >${PartyMemberEvaluation.partyLeagueMember.xM }</td>
				<td class="table-titleTD" style="width: 15%" >性别:</td>
				<td class="table-contentTD" style="width: 15%" >${PartyMemberEvaluation.partyLeagueMember.xB }</td>
				<td class="table-titleTD" style="width: 15%" >工号:</td>
				<td class="table-contentTD" style="width: auto;" >${PartyMemberEvaluation.partyLeagueMember.gH }</td>
			</tr> 
		    <tr>
				<td class="table-titleTD" style="width: 15%" >所在党支部:</td>
				<td class="table-contentTD" style="width: 20%">${PartyMemberEvaluation.partyLeagueMember.partyBranch.dZBMC }</td>
				<td class="table-titleTD" style="width: 15%" >党籍状态:</td>
				<td class="table-contentTD" style="width: 15%">
				    <c:if test="${PartyMemberEvaluation.partyLeagueMember.dJZT == '1'}">正常</c:if>
				    <c:if test="${PartyMemberEvaluation.partyLeagueMember.dJZT == '2'}">停止党籍</c:if>
				</td>
				<td class="table-titleTD" style="width: 15%" >民族:</td>
				<td class="table-contentTD" style="width: auto;">${PartyMemberEvaluation.partyLeagueMember.mZ }</td>
			</tr> 
			<tr>
				<td class="table-titleTD" style="width: 15%" >身份证号:</td>
				<td class="table-contentTD" style="width: 20%">${PartyMemberEvaluation.partyLeagueMember.sFZH }</td>
				<td class="table-titleTD" style="width: 15%" >出生日期:</td>
				<td class="table-contentTD" style="width: 15%">${PartyMemberEvaluation.partyLeagueMember.cSRQ }</td>
				<td class="table-titleTD" style="width: 15%" >联系电话:</td>
				<td class="table-contentTD" style="width: auto;">${PartyMemberEvaluation.partyLeagueMember.lXDH }</td>
			</tr> 
			<tr>
				<td class="table-titleTD" style="width: 15%" ><font style="color: red;">*</font>评定学期:</td>
				<td class="table-contentTD"  style="width: 20%">
				    <select id="semId" name="semId" class="inputText required">
				<!--  <option value="">全部</option> -->
				 <c:forEach items="${sList}" var="semester">
				 	<option value="${semester.xqid}">${semester.xqmc}</option>
				 </c:forEach>
				</select>
				</td>
				<td class="table-titleTD" style="width: 15%" >总得分:</td>
				<td class="table-contentTD"  style="width: 15%">
				 <input type="text" id="totalScore" name="totalScore"  value="${PartyMemberEvaluation.totalScore }" maxlength="100"  readonly="readonly" />
				</td>
				<td class="table-titleTD" style="width: 15%" ></td>
				<td class="table-contentTD"  style="width: auto;"></td>
			</tr> 
			<tr>
				<td class="table-titleTD">备注:</td>
				<td class="table-contentTD" colspan="5">
				 <textarea rows="4" cols="150" name="remark" id="remark"  readonly="readonly" placeholder="备注" id="remark" maxlength="2000" >${PartyMemberEvaluation.remark }</textarea>
			    </td>
			</tr> 
		</table>
		<br/>
		<table cellpadding="0" cellspacing="0" border="0" class="table-border"
			width="100%" id="Table">
			<tr>
				<td class="table-header" colspan="4">评分</td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width: 25%" >序号</td>
				<td class="table-titleTD" style="width: 25%" >项目</td>
				<td class="table-titleTD" style="width: 25%" >分值</td>
				<td class="table-titleTD" style="width: 25%" >得分</td>
			</tr> 
		       <c:forEach items="${evalItems}" var="evalItem">
				    <tr class="evaTr">
						<td class="table-contentTD" style="width: 25%">${evalItem.itemId }</td>
						<td class="table-contentTD" style="width: 25%" >${evalItem.itemName }</td>
						<td class="table-contentTD" style="width: 25%" >${evalItem.itemScore }</td>
						<td class="table-contentTD" style="width: 25%" id="box">
						     <input type="text" class="score" name="score"  maxlength="100" re/>
						</td>
						
					</tr> 
			   </c:forEach>
			</table>
		<table cellpadding="1" cellspacing="1" border="0" align="left">
			<c:if test="${_login_user_type==2}">
			<tr>
				<td>
				<kl:permission permisstionList="${permisstionList}"
               currentUser="${_login_console_user}"
               currentCatalogId="<%=CatalogUtils.getCatalogId(\"ZHDJ_KHGL_XFZS\")%>" key="modify">
				<input type="button" id="btnSave" class="inputButton"
					style="text-align: center;" value="保存" />
				</kl:permission>
				</td>
				<td>
				<input type="button" id="Cancel" class="inputButton"
					style="text-align: center;" value="取消" /></td>
				<td><input type="button" id="returnBut" class="inputButton"
					value="返回" style="text-align: center;" /></td>
			</tr>
		 </c:if>
		</table>
	</form>
	<script>
	$("#box input").blur(function(){
		var trLength = $("#Table tr").length;
		var count = 0       ;
		//console.log($("#Table tr").eq(2).find(".score").val());
		for(var i = 2;i<trLength;i++){
			var score = $("#Table tr").eq(i).find(".score").val();
			var IntScore = parseInt(score);
			if(isNaN(IntScore)){
				continue;
			}else{
				count += IntScore;
				$("#totalScore").val(count);
			}
		}
		//$("#totalScore").val(count);
	});
			$(document).ready(function() {
				
				var _form=$("#Form").validate();
				/* 保存  */
				$("#btnSave").click(function() {
					console.log(_form)
					if(_form.form()){
						document.Form.action ="${basePath}/dyxfzs/update";
						document.Form.submit();
						//validataSave();
					}
				});
				/* 返回 */
				$("#returnBut").click(function() {
		 			   window.location.href='${basePath}/dyxfzs/list';
		 		});
				/*  取消 */
				$("#Cancel").click(function() {
					   var zSID = $("#zSID").val;
					   window.location.href = "${basePath}/dyxfzs/edit";
		 		});
			});
			
			   if("${msg}"!=""){
			       layer.alert("${msg}", {icon: 6});
			  } 
			/* 选择 */
		   function showdiv() {
				$('#div1').dialog('open');
			} 
		   if("${msg}"!=""){
		       layer.alert("${msg}", {icon: 6});
		  }
		</script>
</body>
</html>
